-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
test_runner: show interrupted test on SIGINT #61676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Review requested:
|
When the test runner process is killed with SIGINT (Ctrl+C), display which test was running at the time of interruption. This makes it easier to identify tests that hang or take too long. - Add `test:interrupted` event emitted when SIGINT is received - Add `interrupted()` method to TestsStream - Handle the event in both TAP and spec reporters - TAP outputs: `# Interrupted while running: <test>` - Spec outputs with yellow header and warning symbol - Use setImmediate to allow reporter stream to flush before exit With process isolation (default), shows the file path since the parent runner only knows about file-level tests. With --test-isolation=none, shows the actual test name.
dbbd948 to
ad00a26
Compare
JakobJingleheimer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea/feature, and the initial implementation LGTM 🙂
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #61676 +/- ##
==========================================
- Coverage 89.74% 89.72% -0.03%
==========================================
Files 674 675 +1
Lines 204360 204592 +232
Branches 39265 39303 +38
==========================================
+ Hits 183412 183560 +148
- Misses 13251 13307 +56
- Partials 7697 7725 +28
🚀 New features to boost your workflow:
|
| defined. | ||
| The corresponding execution ordered event is `'test:complete'`. | ||
|
|
||
| ### Event: `'test:interrupted'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ### Event: `'test:interrupted'` | |
| ### Event: `'test:interrupted'` | |
| <!-- YAML | |
| added: REPLACEME | |
| --> |
Summary
When the test runner process is killed with SIGINT (Ctrl+C), display which test was running at the time of interruption. This makes it easier to identify tests that hang or take too long.
Changes
test:interruptedevent emitted when SIGINT is receivedinterrupted()method to TestsStream# Interrupted while running: <test>Behavior
--test-isolation=none: shows the actual test name and locationExample output (TAP)
Example output (spec)